import service from '@/utils/request';

const prefix = '/question';
export function getQuestionListService(data) {
  return service({
    url: `${prefix}/list`,
    method: 'get',
    params: data,
  });
}

export function addQuestionService(data = {}) {
  return service({
    url: `${prefix}/add`,
    method: 'post',
    data,
  });
}

export function getQuestionDetailService(questionId) {
  return service({
    url: `${prefix}/detail`,
    method: 'get',
    params: {
      questionId,
    },
  });
}

export function editQuestionService(data) {
  return service({
    url: `${prefix}/edit`,
    method: 'put',
    data,
  });
}

export function deleteQuestionByIdService(questionId) {
  return service({
    url: `${prefix}/delete`,
    method: 'delete',
    params: {
      questionId,
    },
  });
}